package guoanmaker.provider.business.service;

import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import guoanmaker.provider.business.model.ProvideUser;
import guoanmaker.provider.business.repository.ProvideUserRepository;


/**
 * Mock implementation.
 * 
 * @author vladimir.stankovic
 *
 * Aug 4, 2016
 */
@Service
public class ProvideUserService implements ProvideUserServiceInterface{
	private final ProvideUserRepository provideUserRepository;
	
	@Autowired
    public ProvideUserService(ProvideUserRepository provideUserRepository) {
        this.provideUserRepository = provideUserRepository;
    }
    
    public ProvideUserRepository getProvideUserRepository() {
        return provideUserRepository;
    }

    @Override
    public Optional<ProvideUser> getByUsername(String username) {
        return this.provideUserRepository.findByUsername(username);
    }

}
